<!-- Teacher_NewCourseListWin.html -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>教师端课程列表</title>
		<link rel="stylesheet" href="../../css/base.css">
		<!--<link rel="stylesheet" href="../../css/CFNetPP_Base.css">-->
		<style type="text/css">
			.nav-right-img {
				width: 24px;
				margin-left: 12px;
				margin-top: 8px;
			}
			.nav-right-scan-img {
				width: 20px;
				margin-left: 14px;
				margin-top: 12px;
			}
			.base_icon{
				width: 22px;
				position: absolute;
				right: 10px;
				top: 10px;
			}
			.base_right_item{
				position: relative;
			}
		</style>
	</head>
	<body>
		<div class="base_style_color" id='BarAppearance' ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span>课程</span>
			<a class="base_right_item nav-item" href="#" onclick="onAddPlanClick()"> <img src="../../icon/addNew@3x.png" class="base_icon"> </a>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/push.js"></script>
	<script type="text/javascript" src="../../script/ui.js"></script>
	<script type="text/javascript">

		apiready = function() {
			initHeaderUI();
			setupSubframe();
			api.addEventListener({
				name : 'viewappear'
			}, function(ret, err) {
				setupMsgBtnStatus();
			});
			api.addEventListener({
				name : 'pushMessage'
			}, function(ret, err) {
				pushMessage();
			});
		}
		//push 消息提醒
		function pushMessage() {
			var jid = $api.getStorage('cfnetppjxid');
			var msgVal = $api.getStorage('cfnetppmessagejiaoxue' + jid);
			console.log("msgVal : " + msgVal);
			if (msgVal == 1) {
				$('#redPointMessage').show();
			} else {
				$('#redPointMessage').hide();
			}
		}

		function setupMsgBtnStatus() {
			api.sendEvent({
				name : 'click_pushMessage_index'
			});
		}

		function setupSubframe() {
			sendBuriedNotifi(0, '课程列表', '006');
			var y = $('#BarAppearance').height() + $('.base_navigation_bar').height();
			var h = api.winHeight - y;
			api.openFrame({
				name : 'Teacher_NewCourseList',
				url : 'Teacher_NewCourseList.html',
				rect : {
					x : 0,
					y : y,
					w : 'auto',
					h : h
				},
				pageParam : {
					sourceurl : window.location.pathname,
					sourcetitle : document.title
				},
				bounces : false
			});
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername')
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		function backClick() {
			api.closeWin();
			sendBuriedNotifi(1, '课程列表', '006');
		}

		function toMessageClick() {
			sendBuriedNotifi(1, '课程列表', '006');
			api.openWin({useWKWebView:true,
				name : 'Teacher_ToDoMessageWin',
				url : 'Teacher_ToDoMessageWin.html',
				pageParam : {
					sourceurl : window.location.pathname,
					sourcetitle : document.title
				},
			});
		}
		function onAddPlanClick(){
			api.openWin({useWKWebView:true,
			    name: 'StudyCreatPlan_Win',
			    url: '../StudyPlanManage/StudyCreatPlan_Win.html',
			    pageParam: {
			        currenttype: 'creat',
			        sourceurl : window.location.pathname,
					sourcetitle : document.title
			    }
			});
		}
	</script>
</html>